package com.topfinance.cnaps2.web.sys;

import java.util.HashMap;
import java.util.List;

import com.topfinance.cnaps2.ebo.TblTxEbo;
import com.topfinance.cnaps2.service.ITblTxManager;
import com.topfinance.frame.web.BaseSupport;
import com.opensymphony.xwork2.ModelDriven;

/**
 * <p>
 * Description:
 * </p>
 * 
 * @author
 * @version 1.50
 *          <p>
 *          Copyright: Copyright (c) 2004 2005
 *          </p>
 *          <p>
 *          Company:
 *          </p>
 */
public final class TblTxAction extends BaseSupport implements ModelDriven<TblTxEbo> {

	private ITblTxManager tblTxManager = null;

	private TblTxEbo transEbo = new TblTxEbo();

	public TblTxEbo getModel() {
		return transEbo;
	}

	public void setTblTxManager(ITblTxManager tblTxManager) {
		this.tblTxManager = tblTxManager;
	}

	public TblTxAction() {
		super();
	}

	public String execute() {
		return list();
	}

	public String list() {
		log.debug("TblTxAction-list begin");
		try {
			List l = tblTxManager.getAllTblTxList();
			rtnResultMap = new HashMap();
			rtnResultMap.put(DATA_LIST_ROOT, l);
			rtnResultMap.put(RECORDS_COUNT, l.size());
		} catch (Exception e) {
			handleException(e);
		}
		log.debug("TblTxAction-list end");
		return SUCCESS;
	}

	public String getxml() {
		log.debug("TblResendAction-list begin");
		try {
			String auditid = request.getParameter("auditid");			
			List l = tblTxManager.getTblTxXml(auditid);
			rtnResultMap = new HashMap();
			rtnResultMap.put(DATA_LIST_ROOT, l);
			rtnResultMap.put(RECORDS_COUNT, l.size());
		} catch (Exception e) {
			handleException(e);
		}
		log.debug("TblResendAction-list end");
		return SUCCESS;
	}
	
}
